#ifndef __DAEMON_SUB_PROCESS_H__
#define __DAEMON_SUB_PROCESS_H__

#include "unistd.h"
#define MAX_FAIL_COUNT 5 // 子进程最大失败次数
#define EXE_PATH "/usr/bin/gateway"

typedef struct
{
    int pid;
    char *cmd_param;
    int fail_count;
}subProcess;

/**
 *  初始化子进程    
 */
subProcess *daemon_subProcess_init(char *sub_cmd);

/**
 *  检查并启动子进程
 */
int daemon_subProcess_checkStart(subProcess *sub_process);

/**
 * 结束子进程
 * 
 */
void daemon_subProcess_stop(subProcess *sub_process);

#endif /* __DAEMON_SUB_PROCESS_H__ */
